package com.example.xiaoshuo_yudu.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.xiaoshuo_yudu.entity.entity.Books;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 小说基本信息表 Mapper 接口
 * </p>
 *
 * @author xusen
 * @since 2025-07-24
 */
@Mapper
public interface BooksMapper extends BaseMapper<Books> {
    @Select("select distinct category from books where target_user=1")
    List<String> getBoyList();
    @Select("select distinct category from books where target_user=2")
    List<String> getGirlList();
    @Select("select distinct category from books where create_time > DATE_SUB(CURDATE(), INTERVAL 30 DAY)")
    List<String> getNewList();
//    获取 分类
    @Select("select category from books where book_id=#{bookId}")
    String getCategoryById(Integer bookId);



}
